package com.nanyang.tms.api.dto.request.saleprice;


import com.nanyang.common.core.domain.ApiRequest;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.math.BigDecimal;

@Data
public class SalePriceDiscountRequest extends ApiRequest {

    private static final long serialVersionUID = -2019769756297012618L;
    /**
     * 价格折扣编码
     */
    @Length(max = 32, message = "discountCode长度需小于32个字符")
    private String discountCode;

    /**
     * 会员等级编码
     */
    @NotEmpty(message = "会员等级编码不能为空")
    @Length(max = 20, message = "levelCode长度需小于20个字符")
    private String levelCode;

    /**
     * 会员等级名称
     */
    @NotEmpty(message = "会员等级名称不能为空")
    @Length(max = 30, message = "levelName长度需小于30个字符")
    private String levelName;

    /**
     * 折扣值
     */
    @NotNull(message = "折扣值不能为空")
    @Digits(integer = 9, fraction=1, message = "discountValue格式不正确")
    @DecimalMin(value = "0.1", message = "discountValue格式不正确")
    @DecimalMax(value = "9.9", message = "discountValue格式不正确")
    private BigDecimal discountValue;
    @Override
    public void requestCheck() {

    }
}
